import * as THREE from 'three';
const model = new THREE.Group();
const geometry = new THREE.BoxGeometry(1, 1, 1);
const material = new THREE.MeshBasicMaterial({color: 0x00ff00});
const mesh = new THREE.Mesh(geometry,material)
mesh.position.set(2, 0, -3);//物体位置在人右边    
const material2 = new THREE.MeshBasicMaterial({color: 0x00ffff});
const person = new THREE.Mesh(geometry,material2)
person.position.set(0, 0, 2);//人位置
// a向量：假设人的正前方沿着z轴负半轴
const a = new THREE.Vector3(0, 0, -5);
const b = mesh.position.clone().sub(person.position)
// 可视化向量a
const arrowA  = new THREE.ArrowHelper(a.clone().normalize(), person.position, 10, 0xff0000);
const c = new THREE.Vector3
c.crossVectors(a,b)
// 如果c的方向朝下，就是在右边，如果朝上，在左边
const arrowC = new THREE.ArrowHelper(c.clone().normalize(), person.position, c.length(), 0x00ff00);

model.add(mesh,person,arrowA,arrowC);


export default {model};